package com.joeyzh.base;

/**
 * Created by Joey on 2018/12/4.
 * MVVM的构造器
 *
 * @author by Joey
 */

public interface MvvmCreateDelegate<Entity, VM extends IViewModel<Entity>, PT extends IPresenter<VM>> {
    /**
     * @param viewModel
     * @return presenter
     * 创建presenter并返回
     */
    PT createPresenter(VM viewModel);

    /**
     * @param entity
     * @return 创建ViewModel并返回
     */
    VM createViewModel(Entity entity);

    /**
     * @return 返回实体
     */
    Entity getEntity();
}
